﻿using System;
using Ewk.MachineLearning.Classification.Conversions;
using Ewk.Math.Algebra;
using Ewk.Math.ComputationTypes;

namespace Ewk.MachineLearning.Clustering.MultidimensionalScaling
{
    public class EntityAngleContainer : EntityDifferenceContainer<double>
    {
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="entityType">The <see cref="Type"/> of the entity.</param>
        /// <param name="vectors">The <see cref="EntityVector{T}"/> list to calculate difference angles for.</param>
        public EntityAngleContainer(Type entityType, params EntityVector<double>[] vectors)
            : base(entityType, Vector<double>.CosAngle, vectors)
        {
        }

        public override Computable<double> this[int i, int j]
        {
            get
            {
                return Computable<double>.Factory.Create(
                    System.Math.Acos(base[i, j].Value)*18.0);
            }
        }
    }
}